<template>
  <NuxtLayout>
    <!-- 个人介绍 -->
    <Introduction id="Introduction" />

    <!-- technology  -->
    <Technology id="Technology" />

    <!-- Service -->
    <Service id="Service" />

    <!-- Articles -->
    <Articles id="Articles" />

    <!-- Projects -->
    <Projects id="Projects" />

    <FloatingButton />
  </NuxtLayout>
</template>

<script setup lang="ts">
const { $mitt } = useNuxtApp();

// 滚动到这个页面
$mitt.on("scrollToNextSection", (e: any) => {
  let url: any = {
    999: document.getElementById("section"),
    0: document.getElementById("Introduction"),
    1: document.getElementById("Technology"),
    2: document.getElementById("Service"),
    3: document.getElementById("Articles"),
    4: document.getElementById("Projects"),
  };

  url[e].scrollIntoView({ behavior: "smooth" });
});
</script>

<style lang="less" scoped></style>
